﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Framework.MVC.Validation
{
    public interface IUniValidate
    {
        #region 验证接口
        /// <summary>最后必需调用</summary>
        MvcHtmlString ToString();
        /// <summary>不能为空</summary>
        IUniValidate NotEmpty(string message = "不能为空");
        /// <summary>是否为Email格式</summary>
        IUniValidate EmailAddress(string message = "必需为Email格式");
        /// <summary>正则验证</summary>
        IUniValidate Regex(string regex, string message = "不正确");
        /// <summary>中文</summary>
        IUniValidate AllChinese(string message = "必需为中文");
        /// <summary>与另一个控件值是否相等</summary>
        IUniValidate EqualTo(string equalElement, string message = "不相同");
        /// <summary>不能与另一个控件相等</summary>
        IUniValidate NotEqualTo(string equalElement, string message = "不能相同");
        /// <summary>不能小于最小值</summary>
        IUniValidate Min(int num, string message = "数字太小");
        /// <summary>不能大于最大值</summary>
        IUniValidate Max(int num, string message = "数字太大");
        /// <summary>长度不能小于</summary>
        IUniValidate MinLength(int num, string message = "长度太短");
        /// <summary>长度不能大于</summary>
        IUniValidate MaxLength(int num, string message = "长度太长");
        /// <summary>验证长度在指定的区间内</summary>
        IUniValidate Length(int min, int max, string message = "长度不正确");
        /// <summary>身份证号码验证</summary>
        IUniValidate IsIDCardNo(string message = "不是有效的身份证");
        /// <summary>远程验证 使用post方式 根据远程返回的Boolen值进行验证 true:表示可以提交，不显示错误提示 false:表示不可以提交，显示错误提示</summary>
        IUniValidate Ajax(string url, string message);
        /// <summary>日期验证</summary>
        IUniValidate Date(string message = "日期不正确");
        /// <summary>网址验证</summary>
        IUniValidate Url(string message = "网址不正确");
        /// <summary>Decimal 型数字验证</summary>
        IUniValidate Decimal(string message = "不是有效的数字");
        /// <summary>检测是否为IP地址</summary>
        IUniValidate IsIP(string message = "IP不正确");
        /// <summary>不包含Html代码</summary>
        IUniValidate NoHtml(string message = "不能包含标示符");
        /// <summary>不能包含中文或全角字符验证</summary>
        IUniValidate NoChinese(string message = "不能是中文");
        /// <summary>判断是否是标准字符 如果包含非标准字符 报错</summary>
        IUniValidate IsLegalXmlString(string message = "xml格式错误");
        /// <summary>非 正则表达式，即不匹配此正则</summary>
        IUniValidate NotRegex(string regex, string message);
        /// <summary>Char最大长度</summary>
        IUniValidate CharCodeLength(int num, string message = "长度不正确");
        #endregion
    }
}
